package edu.webtek.graven;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class ShopBase extends HttpServlet{
	private static final long serialVersionUID = 6288293579721945918L;
	private CloudCommunication cloud = new CloudCommunication();
	private SessionData sessionData;
	private void getSessionVariables(HttpSession session){
		sessionData = new SessionData(session);
	}
	protected SessionData getSessionData(){
		return sessionData;
	}
	public CloudCommunication getCloud() {
		return cloud;
	}	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		getSessionVariables(req.getSession());
		req.setAttribute("sessionData", sessionData);
		resp.setCharacterEncoding("utf-8");
	}
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		getSessionVariables(req.getSession());
		req.setAttribute("sessionData", sessionData);
		resp.setCharacterEncoding("utf-8");
	}
}
